<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
include_once('Mysql_connect.inc');//启动连接，连接名：$conn

echo '<table>';
echo '<tr>';
echo '<th>sa_id</th>';
echo '<th>title</th>';
echo '<th>description</th>';
echo '<th>president_name</th>';
echo '<th>membership</th>';
echo '</tr>';
$result = mysqli_query($conn, 'SELECT sa_id, title, description, president_name, membership FROM studentassociation');
while (($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) != NULL) {
    echo '<tr>';
    echo '<td>' . $row['sa_id'] . '</td>';
    echo '<td>' . $row['title'] . '</td>';
    echo '<td>' . $row['description'] . '</td>';
    echo '<td>' . $row['president_name'] . '</td>';
    echo '<td>' . $row['membership'] . '</td>';
    echo '</tr>';
}
mysqli_free_result($result);
echo '</table>';


include_once('Mysql_unconnect.inc'); //断开连接
?>
